nd=0;
for i=1:4
    nd=(a(i)-b(i))*(a(i)-b(i))/(s(i)*s(i))+nd;
end

nd=sqrt(nd)